package cc.owoo.godpen.reflect;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;

/**
 * 字段值获取
 * Created by nimensei
 * 2022-05-16 上午 10:27
 **/
public record FieldGet(Field field) implements ValueGet {
    @Override
    public Object get(Object object) throws InvocationTargetException, IllegalAccessException {
        if (object == null)
            return null;
        return field.get(object);
    }
}
